package cn.tedu.csmall.stock.webapi.quartz;

import cn.tedu.csmall.stock.webapi.mapper.StockMapper;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class QuartzStock implements Job {

    @Autowired
    private StockMapper stockMapper;

    @Override
    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
        System.out.println("执行增加库存的方法");

        stockMapper.updateStockCountByCommodityCode("PC100",-10);
    }
}
